<?php
/**
 * 绿城通单点登录服务
 */
namespace service;

use think\Cache;
use think\Request;
use think\Db;


class SsoService
{
    const SECURITYKEY = "NRV23XDnyj5ntF0CpL8o";

    /**
     * @var object 对象实例
     */
    protected static $instance;

    /**
     * 初始化
     * @access public
     * @param array $options 参数
     * @return \think\Request
     */
    public static function instance($options = [])
    {
        if (is_null(self::$instance)) {
            self::$instance = new static($options);
        }
        return self::$instance;
    }

    public function verify($uid,$timestamp,$token){
        if(empty($uid) || empty($timestamp) || empty($token)){
            return false;
        }
        return base64_encode(md5($uid.$timestamp.self::SECURITYKEY)) == $token;
    }
}